<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改商品信息</title>
<style type="text/css">
body {
	background-image: url("image/body_bj.jpg");
	font-size: 12px;
}

i {
	font-style: normal;
}

.detail {
	padding-left: -2px;
}

.formField {
	overflow: auto;
	width: 100%;
	margin: 5px 0;
}

label {
	min-width: 100px;
	float: left;
	display: block;
	margin-right: 5px;
	padding-left: 10px;
	text-transform: capitalize;
}

.formText {
	display: block;
	float: left;
}
</style>
<script type="text/javascript">
	function check() {
		var name = document.getElementById("lastName").value;
		var price = document.getElementById("lastPrice").value;
		var detail = document.getElementById("detail").value;
		var rs = true;
		if (name == null || name == '') {
			rs = false;
		}
		if (price == null || price == '' || price == "只能输入正数和小数点哦！") {
			rs = false;
		}
		if (detail == null || detail == '') {
			rs = false;
		}
		if (rs == false) {
			alert("有选项未填写！请核对信息！")
		}
		return rs;
	}
</script>
</head>
<body>
	<div style="width: 100%; text-align: center;" class="update">
		<h4>修改菜品</h4>
		<hr>
		<div>
			<c:if test="${not empty gv.image}">
				<img src="upload/${gv.image }" width="85px" height="85px"
					style="padding-bottom: 3px">
			</c:if>
			<c:if test="${empty gv.image }">
				<img src="image/noImg.png" width="85px" height="85px"
					style="padding-bottom: 3px">
			</c:if>
		</div>
		<form action="GoodsServlet" method="post" onsubmit="return check()">
			<input type="hidden" name="op" value="3"> <input
				type="hidden" name=cid value="${gv.goods_id}"> <input
				type="hidden" name="curpage" value="${param.curpage}"> <input
				type="hidden" name="pagesize" value="${param.pagesize}">
			<div class="formField clearfix">
				<label for="lastName">菜名:</label> <input type="text"
					class="formText" id="lastName" name="g_name" value="${gv.name}" />
			</div>
			<div class="formField clearfix">
				<label for="lastName">价格:</label> <input type="text"
					class="formText" id="lastPrice" name="g_price" value="${gv.price}"
					onkeyup="value=value.replace(/[^\d.]/g,'')" value="只能输入正数和小数点哦！"
					onfocus="this.value='';" />
			</div>
			<div class="formField clearfix">
				<label for="email">描述:</label>
				<textarea rows="2" cols="23" name="g_detail" id="detail">${gv.detail}</textarea>
			</div>
			<div>
				<input type="submit" value="提交">
			</div>
		</form>
	</div>
</body>
</html>